package com.server.impl;

import com.dao.admin.AdminMapper;
import com.pojo.Admin;
import com.server.AdminService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class AdminServiceImpl implements AdminService {

    @Resource
    AdminMapper adminMapper;
    @Override
    public Admin getLoginAdmin(String name, String password) {
        return adminMapper.getLoginAdmin(name, password);
    }

    @Override
    public Admin findAdminByLoginName(String name) {
        return adminMapper.findAdminByLoginName(name);
    }

    @Override
    public List<Admin> getAdd(String name, String description) {
        return adminMapper.getAdd(name,description);
    }

    @Override
    public int deleteById(int adminid) {
        return adminMapper.deleteById(adminid);
    }

    @Override
    public int addByID(String name) {
        return adminMapper.addByID(name);
    }

    @Override
    public int getallcount() {
        return adminMapper.getallcount();
    }

    @Override
    public Admin selectAdminById(int adminid) {
        return adminMapper.selectAdminById(adminid);
    }

    @Override
    public int updateAdmin(int adminid, String name, String password,int age, String sex, String phone,String rolename) {
        return adminMapper.updateAdmin(adminid,name,password,age,sex,phone,rolename);
    }

    @Override
    public int addadmin(String name,String password,int age, String sex, String phone,String rolename) {
        return adminMapper.addadmin(name,password,age,sex,phone,rolename);
    }

    @Override
    public List<Admin> getsearch(String name) {
        return adminMapper.getsearch(name);
    }

    @Override
    public List<Admin> getadminList() {
        return adminMapper.getadminList();
    }

}
